home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / comms / other / dwarfx-tng / dwarfx / dwarfmping.amirx < prev    next >
Text File  |  1999-04-19  |  2KB  |  6 lines

  1. /* DWaRFMPing.AmIRX By Karniv4
  2. \\
  3. // Adapted for DWaRFx release by Coolwave + Gaz
  4. \\
  5. */
  6. Parse UPPER ARG outputtype;dfxlogo='P='d2c(27)'b«DWaRFMPiNG»';bld=d2c(2);"Echo "dfxlogo" "bld"|DWaRFx-TNG|"bld" Graphical MassPing [By Karniv4]";If outputtype="PRIV" then output_command="ECHO "dfxlogo;else output_command="SAY";numofsegs=20;maxwait=30;div='01'x;options results;"getmynick";mynick=Upper(result);"getusers";userlist=Compress(result,'@+');userlist=Delword(userlist,Find(Upper(userlist),mynick),1);userfind=Upper(userlist);usercount=Words(userlist);"ECHO "dfxlogo" Awaiting responses from" usercount "users OR approx "maxwait" seconds to elapse";"getchannel";currentchan=result;replycnt=0;do lpcnt=1 to usercount;userresp.lpcnt=0;end;Call Time('r');"RAW PRIVMSG "currentchan" :"div"PING "Time('e')||div;waitend=Time('e')+maxwait;Do until (replycnt>=Usercount)|(Time('e')>waitend);"GETLINE";Parse UPPER var line.rest (div) recommand (div);If (Word(recommand,1)~="PING")&(line.command~="NOTICE") Then Iterate;ourtime=Time('e');resptime=Word(recommand,2);Parse UPPER var line.prefix user'!'bin;user=Find(userfind,user);If (Datatype(resptime)='NUM')&(user~=0) then;do;replycnt=replycnt+1;userorder.replycnt=user;userresp.user=ourtime-resptime;"ECHO "dfxlogo" Ping response from" Word(userlist,user) userresp.user "..." usercount-replycnt "responses outstanding";End;End;maxtime=0;maxlen=0;do lpcnt=1 to usercount;if userresp.lpcnt=0 Then;Do;userresp.lpcnt=30;replycnt=replycnt+1;userorder.replycnt=lpcnt;End;if userresp.lpcnt>maxtime then maxtime=userresp.lpcnt;userlen=length(Word(userlist,lpcnt));if userlen>maxlen then maxlen=userlen;end;segment=maxtime/numofsegs;output_command bld"|DWaRFx-TNG|"bld" Graphical MassPing ["mynick"]";output_command left("User",maxlen,"=")||"=="||center("Lagg",numofsegs,"=")||"=====Secs==";do lpcnt1=1 to replycnt;lpcnt=userorder.lpcnt1;outline="";outline=outline||Left(Word(userlist,lpcnt),maxlen)' | ';outline=outline||d2c(22) Left(copies(" ",trunc(userresp.lpcnt/segment,0))||d2c(22),numofsegs+1);outline=outline' | 'userresp.lpcnt;If userresp.lpcnt='30' Then outline=outline'.0+';output_command outline;Call Time('r');Do Until Time('e')>1;End;end;Exit